{extend name="layout" /}
{block name="content"}
<div class="row">
  <div class="col-xs-3">
    <form id="searchForm">
      <div class="input-group input-group-sm demoTable">
        <input type="text" class="form-control input-sm" name="keywords" id="demoReload" autocomplete="off" placeholder="请输入姓名">
        <span class="input-group-btn">
          <button type="button" class="btn btn-info btn-flat layui-btn" data-type="reload">搜  索</button>
        </span>
      </div>
      <input type="hidden" name="typeid" value="{$typeid}"> 
      <input type="hidden" name="kind" value="{$kind}"> 
    </form>
  </div>
  <div class="col-xs-9" style="text-align: right"> 
    <button type="button" class="btn btn-info btn-sm export" title="经纪人报表"><i class="fa fa-edit"></i> 数据导出</button>
  </div>
</div>
<table class="layui-table" lay-data="{height: 'full-75', cellMinWidth: 80, page: true, limit:30, id:'lists', url:'{:url('data_show_where', ['typeid'=>$typeid, 'kind'=>$kind])}'}" lay-filter="lists"> 
  <thead>
    <tr>
      <th lay-data="{type:'checkbox'}">ID</th>
      <th lay-data="{field:'id', sort: true, width:80, align:'center'}">ID</th>
      <th lay-data="{field:'realname'}">经纪人</th>
      <th lay-data="{field:'dealer'}">所属经销商</th>
      <th lay-data="{field:'clients'}">提交线索数量</th>
      <th lay-data="{field:'price'}">成交总额</th>
      <th lay-data="{field:'suc_clients'}">成交客户</th>
      <th lay-data="{field:'addday'}">统计时间</th>
    </tr> 
  </thead>
</table>
<script type="text/html" id="barDemo">
</script>
{/block}
{block name="script"}
<script type="text/javascript">
  layui.use('table', function(){
    var table = layui.table;
    var $ = layui.$, active = {
      reload: function(){
        //执行重载
        table.reload('lists', {
          page: {
            curr: 1 //重新从第 1 页开始
          }
          ,where: $('#searchForm').serializeObject()
        });
      }
    };
    $('.demoTable .layui-btn').on('click', function(){
      var type = $(this).data('type');
      active[type] ? active[type].call(this) : '';
    });
  });
</script>
{/block}